package com.example.demo.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.example.demo.pojo.Admin.Admin;
import com.example.demo.pojo.R;
import com.example.demo.pojo.User.InvitedUserDTO;
import com.example.demo.pojo.User.LoginRequest;
import com.example.demo.pojo.User.User;
import com.example.demo.pojo.User.UserInfoDTO;
import com.example.demo.pojo.vip.VipUserDto;
import org.apache.poi.ss.formula.functions.T;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.Serializable;
import java.util.List;
import java.util.Map;

public interface UserService extends IService<User>, Serializable {

    R<T> userLogin(LoginRequest loginRequest, HttpServletResponse response,
                   HttpServletRequest request);

    R<T> adminLogin(LoginRequest loginRequest, HttpServletResponse response, HttpServletRequest request);

    R<T> outLogin(String token, HttpServletResponse response);

    R<T> adminOtLogin(String token, HttpServletResponse response);

    R<T> register(User user, HttpServletRequest request);

    R<T> findPassWord(String email, String newUserName, String newPassWord, String code);

    R<T> updateUserAvatar(User user, HttpServletRequest request, String token);

    R<UserInfoDTO> queryCurrentUserInfo(String token);

    R<T> updateUserInfo(String token, User user);

    R<T> clearUser(String token, Integer time);

    User getByUserName(String userName);

    Admin getByAdminUserName(String username);

    R<Map<String, Object>> getAllUser(int pageNum, int pageSize);

    R<Map<String, Object>> getAllCompetition(int pageNum, int pageSize);

    R<User> getUserById(Integer id);

    R<T> banUserById(Integer id);

    R<Long> getCountTodayActiveUsers();

    R<Long> getCountYesterdayActiveUsers();

    R<Long> getActiveUsersCounts(Integer time);

    R<List<VipUserDto>> getExpireVipUsers();

    R<Long> getUserVipExpireDay(String token);

    R<List<InvitedUserDTO>> getUserIdByName(String realName);

    R<Map<String, Object>> getUserLoginLog(Integer pageNum, Integer pageSize);

    R<Map<String, Object>> getAdminLoginLog(Integer pageNum, Integer pageSize);
}
